import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/index'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/index',
      component: Index,
      children: [
        {
          path: 'home',
          component: require('../views/rage')
        },
        {
          path: 'hot-singer',
          component: require('../views/hotSinger')
        },
        {
          path: 'song-list',
          component: require('../views/songList')
        },
        {
          path: 'user',
          component: require('../views/user')
        },
        {
          path: 'all-songs',
          component: require('../views/MusicStore')
        }

      ]
    },
    {
      path: '/user/login',
      component: require('../views/login')
    },
    {
      path: '/user/register',
      component: require('../views/register')
    }, {
      name: 'listDetail',
      path: '/list-details/:id',
      component: require('../views/listDetails')
    }, {
      name: 'playerDetail',
      path: '/player-details/:id',
      component: require('../views/playerDetails')
    }, {
      name: 'singerDetail',
      path: '/sing-details/:id',
      component: require('../views/singerDetails')
    }, {
      name: 'collectMusic',
      path: '/user/collect-music',
      component: require('../views/Collect.vue')
    }, {
      path: '*',
      redirect: '/index/home'
    }
  ]
})
